import { axiosInstance } from '@/http';
import { IDeptListRequest, IDeptListResponse, IDeptTreeItem } from './type';
import { systemDepartment } from '@/model/api/system';

/**
 * @description: 部门分页列表查询
 * @param {IDeptListRequest} 参数
 * @returns {Promise}
 */
export const apiPageList = (
  params: IDeptListRequest
): Promise<IDeptListResponse> =>
  axiosInstance.post(systemDepartment.pageList, params);

/**
 * @description 部门树形结构
 * @returns {Promise}
 */
export const apiTreeList = (): Promise<IDeptTreeItem[]> =>
  axiosInstance.get(`${systemDepartment.treeList}`);
